﻿using DEMSoft.Khuong;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace TestEX1
{
    /// <summary>
    ///This is a test class for Ex1Test and is intended
    ///to contain all Ex1Test Unit Tests
    ///</summary>
    [TestClass()]
    public class Ex1Test
    {
        /// <summary>
        ///A test for Ex1 Constructor
        ///</summary>
        [TestMethod()]
        public void Ex1ConstructorTest()
        {
            Ex1 target = new Ex1();
        }

        /// <summary>
        ///A test for GetNearestPoint
        ///</summary>
        [TestMethod()]
        public void GetNearestPointTest()
        {
            double[,] points = { { 0, 0 }, { 0, 1 }, { 1, 1 }, { 1, 0 } }; ; // TODO: Initialize to an appropriate value
            double[] point = { 0.9, 0.9 }; ; // TODO: Initialize to an appropriate value
            int expected = 2; // TODO: Initialize to an appropriate value
            int actual;
            actual = Ex1.GetNearestPoint(points, point);
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for distance
        ///</summary>
        [TestMethod()]
        public void distanceTest()
        {
            double[] p1 = {0,0}; // TODO: Initialize to an appropriate value
            double[] p2 = {1,1}; // TODO: Initialize to an appropriate value
            double expected = Math.Sqrt(2); // TODO: Initialize to an appropriate value
            double actual;
            actual = Ex1.distance(p1, p2);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
    }
}
